<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/11/26
 * Time: 20:31
 */

namespace app\storage\model;

use think\Model;

class SupplierStorageModel extends Model
{
    protected $table = 'iwh_supplier_storage';
    protected $pk = 'uuid';

//    public function Supplier(){
//        return $this->belongsTo('SupplierModel','supplier_uuid','uuid')->bind('company_name');
//    }

    /**根据仓库Uuid获取厂商Uuid
     * @param $id
     * @return mixed
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public  function getSupplierUuidByStorageUuid($id){
        $result = $this->where(['storage_uuid'=> $id])->value('supplier_uuid');
        return $result;
    }
}



